@charset "utf-8";

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.blog-container {
    flex: 1;
    width: 1000px;
    margin: 80px auto 30px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.blog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.blog-header h1 {
    color: #2c3e50;
    font-size: 2em;
    margin: 0;
    font-weight: 600;
}

.create-post-btn {
    background-color: #546d9e;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 10px;
    font-size: 1.1em;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(84, 109, 158, 0.2);
}

.create-post-btn:hover {
    background-color: #3c5a9a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(84, 109, 158, 0.3);
}

.create-post-btn i {
    font-size: 0.9em;
}

.blog-list {
    flex: 1;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: all 0.3s ease;
    margin-bottom: 30px;
    width: 100%;
}

.blog-card {
    width: 100%;
    height: 200px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    position: relative;
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.blog-card-cover {
    width: 280px;
    height: 100%;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}



.blog-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-cover img {
    transform: scale(1.05);
}

.blog-card-content-wrapper {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.blog-card-header h2 {
    margin: 0 0 10px 0;
    font-size: 1.4em;
    color: #2c3e50;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-content {
    color: #666;
    font-size: 0.95em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 15px;
}

.blog-card-footer {
    display: flex;
    gap: 20px;
    color: #888;
    font-size: 0.9em;
}

.blog-card-footer span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.blog-card-footer i {
    font-size: 1em;
    color: #546d9e;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.pagination button {
    padding: 8px 16px;
    border: none;
    background: #546d9e;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95em;
    min-width: 80px;
}

.pagination button:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.pagination button:not(:disabled):hover {
    background: #3c4f7a;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(84, 109, 158, 0.3);
}

.page-numbers {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

.page-number {
    min-width: 32px;
    height: 32px;
    border: none;
    background: white;
    color: #546d9e;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    padding: 0;
}

.page-number:hover {
    background: #f0f4f9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.page-number.active {
    background: #546d9e;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(84, 109, 158, 0.2);
}

.dots {
    color: #666;
    font-weight: bold;
    letter-spacing: 2px;
    padding: 0 4px;
    user-select: none;
}

.no-posts {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    color: #6c757d;
    font-size: 1.1em;
}

/* 在原有样式基础上添加动画 */
.blog-item {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

/* 为每个卡片设置不同的延迟，创造瀑布效果 */
.blog-item:nth-child(1) {
    animation-delay: 0.1s;
}

.blog-item:nth-child(2) {
    animation-delay: 0.2s;
}

.blog-item:nth-child(3) {
    animation-delay: 0.3s;
}

.blog-item:nth-child(4) {
    animation-delay: 0.4s;
}

.blog-item:nth-child(5) {
    animation-delay: 0.5s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 翻页动画 */
.page-transition {
    animation: pageFade 0.3s ease;
}

@keyframes pageFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 加载占位动画 */
.blog-loading-item {
    width: 100%;
    height: 200px;
    background: linear-gradient(90deg,
            #f0f0f0 25%,
            #f8f8f8 50%,
            #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 8px;
    margin-bottom: 20px;
    animation: shimmer 1.5s infinite;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.footer {
    margin-top: auto;
    text-align: center;
    padding: 20px;
    background-color: #f8f9fa;
    color: #6c757d;
}

/* 点赞按钮样式 */
.like-btn {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="%23ff4757"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>') 12 12, auto;
}

.like-btn:hover {
    background-color: rgba(84, 109, 158, 0.1);
}

.like-btn i {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="%23ff4757"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>') 12 12, auto;
}